package com.power.sifa.correction.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  公安推送记录实体类
*/

@Entity
@ApiModel(value="公安推送记录")
@Data
@Table(name="Cre_record_ga",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Cre_record_ga.Cre_record_gaPK.class) 用于复合组件
public class Cre_record_ga extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_cre_record_ga")
    @SequenceGenerator(name = "seq_cre_record_ga", sequenceName = "SEQ_CRE_RECORD_GA", allocationSize = 1)
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private Integer id;

    @ApiModelProperty(value = "人员id")
    private String perid;

    @ApiModelProperty(value = "记录时间", example="2020-10-22 10:03:22")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date rectime;

    @ApiModelProperty(value = "拍摄纬度")
    private Double  latcamera;

    @ApiModelProperty(value = "拍摄经度")
    private Double  lngcamera;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "照片")
    private String photo;

    @ApiModelProperty(value = "发生地点")
    private String addr;

    @ApiModelProperty(value = "推送任务id")
    private String taskid;

    @ApiModelProperty(value = "图片摘要")
    private String smphoto;

    @ApiModelProperty(value = "人脸图片")
    private String facephoto;

    /**
     *  状态文本
     */
    @Transient
    @FieldEnumText(eum="St_deal", valuefield="status")
    private String status_text;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("perid", this.getPerid());
        map.put("rectime", this.getRectime());
        map.put("latcamera", this.getLatcamera());
        map.put("lngcamera", this.getLngcamera());
        map.put("status_text", this.status_text);
        map.put("status", this.getStatus());
        map.put("photo", this.getPhoto());
        map.put("addr", this.getAddr());
        map.put("taskid", this.getTaskid());
        map.put("smphoto", this.getSmphoto());
        map.put("facephoto", this.getFacephoto());
        return map;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (Integer) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Cre_record_gaPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (Integer)key;

        //Cre_record_gaPK pk = (Cre_record_gaPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
